define(function(require){
    'use strict';

    var
        _ = require('underscore'),
        $ = require('jquery'),
        Base = require('../_base/app');

    var Utils = require('core/utils');

    var ZeroClipboard = require('clipboard');

    return Base.extend({

        template: require('tpl!./app.template'),

        onInitialize: function() {
            var view = this;

            ZeroClipboard.config({
                moviePath: window._global.url.cdn_static + '/vendor/plugin/ZeroClipboard.swf',
                trustedDomains: ['*'],
                allowScriptAccess: 'always'
            });

            var clip = new ZeroClipboard(this.$('.js-btn-copy'));
            clip.on('load', function(client) {
                client.on('complete', function(client, args) {
                    Utils.successNotify('复制成功');
                    clip.off('load');
                    view.close();
                });
            });
        }

    });
});
